package org.llc.gof.behavior.iterator.basic;

import java.util.Vector;

public class ConcreteIterator implements Iterator {
	
    private Vector<Object> vector = new Vector<Object>();
	
    public int cursor = 0;
	
	public ConcreteIterator(Vector<Object> _vector){		
		this.vector = _vector;
	}
	
	public boolean hasNext() {
		if(this.cursor == this.vector.size()){
			return false;
		}else{
			return true;
		}
	}
	
	public Object next() {
		Object result = null;
		
		if(this.hasNext()){
			result = this.vector.get(this.cursor++);
		}else{
			result = null;
		}
		return result;
	}

	public boolean remove() {
		this.vector.remove(this.cursor);
		return true;
	}
}
